﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Data;

namespace System
{
    public interface IEBaseDal
    {
        #region GetObjectHash

        /// <summary>
        /// 获取全部对象
        /// </summary>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash();

        /// <summary>
        /// 通过IDataReader返回对象集合
        /// </summary>
        /// <param name="dr">IDataReader</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(IDataReader dr);

        /// <summary>
        /// 通过DataTable返回对象集合
        /// </summary>
        /// <param name="dt">DataTable</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(DataTable dt);

        /// <summary>
        /// 通过DataView返回对象集合
        /// </summary>
        /// <param name="dv">DataView</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(DataView dv);

        /// <summary>
        /// 执行SQL语句，返回对象集合
        /// </summary>
        /// <param name="sql">SQL语句</param>
        /// <param name="parameters">参数集合</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(string sql, List<DBParameter> parameters);

        /// <summary>
        /// 获取符合条件的对象集合
        /// </summary>
        /// <param name="fields">列集合;以","分割,""、null或"*"表示所有列</param>
        /// <param name="filter">筛选条件</param>
        /// <param name="sorts">排序字段及其方式</param>
        /// <param name="parameters">参数集合</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(string fields, string filter, string sorts, List<DBParameter> parameters);

        /// <summary>
        /// 以分页形式获取符合条件的对象集合
        /// </summary>
        /// <param name="pageIndex">页索引</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="recordCount">总记录数。为-1时，将从数据库获取该值</param>
        /// <param name="fields">列集合;以","分割,""、null或"*"表示所有列</param>
        /// <param name="filter">筛选条件</param>
        /// <param name="sorts">排序字段及其方式</param>
        /// <param name="parameters">参数集合</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(int? pageIndex, int? pageSize, ref int? recordCount, string fields, string filter, string sorts, List<DBParameter> parameters);

        /// <summary>
        /// 获取符合条件的对象集合
        /// </summary>
        /// <param name="sqlInfo">封装的筛选信息</param>
        /// <param name="parameters">参数集合</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(SqlInfo sqlInfo, List<DBParameter> parameters);

        /// <summary>
        /// 以分页形式获取符合条件的对象集合
        /// </summary>
        /// <param name="pageInfo">封装的分页数据筛选信息</param>
        /// <param name="parameters">参数集合</param>
        /// <returns>返回结果</returns>
        Hashtable GetObjectHash(PageInfo pageInfo, List<DBParameter> parameters);

        #endregion
    }
}
